home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1997 February / EnigmA AMIGA RUN 15 (1997)(G.R. Edizioni)(IT)[!][issue 1997-02][PLANET CD V].iso / enigma / earcd / sviluppo / svilupp2 / gmsppr10.lha / Global.h < prev    next >
C/C++ Source or Header  |  1996-09-28  |  4KB  |  141 lines

  1. #ifndef GLOBAL_H
  2. #define GLOBAL_H
  3.  
  4. #ifndef EXEC_SEMAPHORES_H
  5. #include <exec/semaphores.h>
  6. #endif
  7.  
  8. #ifndef LIBRARIES_GAMESUPPORT_H
  9. #include "libraries/GameSupport.h"
  10. #endif
  11.  
  12. extern struct GameSupportBase *GameSupportBase;
  13.  
  14. #ifndef PRAGMAS_GAMESUPPORT_PRAGMAS_H
  15. #include "pragmas/GameSupport_pragmas.h"
  16. #endif
  17.  
  18. #ifndef CLIB_GAMESUPPORT_PROTOS_H
  19. #include "clib/GameSupport_protos.h"
  20. #endif
  21.  
  22. /************************************************************************/
  23.  
  24. #ifdef DEBUG
  25. void kprintf(const char *, ...);
  26. #define assert(x) if (!(x)) {kprintf("assertion failed: file %s, line %lu\n",__FILE__,__LINE__); while (*((UBYTE *)0x00bfe001) & 0x80) *((UWORD *)0x00dff180)=0x0f00;}
  27. #define debug_printf(x) kprintf x
  28. #else
  29. #define assert(x) ((void)0)
  30. #define debug_printf(x) ((void)0)
  31. #endif
  32.  
  33. /************************************************************************/
  34.  
  35. LONG (MyWriteChunkBytes)(struct Library *, struct IFFHandle *, const void *, ULONG);
  36. LONG (MyReadChunkBytes)(struct Library *, struct IFFHandle *, void *, ULONG);
  37.  
  38. /************************************************************************/
  39.  
  40. #define ARRAYSIZE(x) (sizeof(x)/sizeof((x)[0]))
  41.  
  42. /************************************************************************/
  43.  
  44. #ifdef __GNUC__
  45. #define INLINE __inline__
  46. #define ALIGN(Variable) Variable __attribute__((aligned(4)))
  47. #else
  48. #define INLINE
  49. #define ALIGN(Variable) __aligned Variable
  50. #endif
  51.  
  52. /************************************************************************/
  53.  
  54. #if defined(__GNUC__) && defined(__OPTIMIZE__)
  55. extern __inline__ ULONG strlen(const char *String)
  56. {
  57.   const char *t;
  58.  
  59.   t=String;
  60.   while(*t++)
  61.     ;
  62.   return ~(String-t);
  63. }
  64. #elif defined(__SASC)
  65. ULONG __builtin_strlen(const char *);
  66. #define strlen(String) __builtin_strlen(String)
  67. #else
  68. ULONG strlen(const char *);
  69. #endif
  70.  
  71. /************************************************************************/
  72.  
  73. #if defined(__GNUC__) && defined(__OPTIMIZE__)
  74. extern inline int strcmp(const char *String1, const char *String2)
  75. {
  76.   int Result;
  77.  
  78.   while (!(Result=*String1++-*String2) && *String2++)
  79.     ;
  80.   return Result;
  81. }
  82. #elif defined(__SASC)
  83. int __builtin_strcmp(const char *, const char *);
  84. #define strcmp(String1,String2) __builtin_strcmp((String1),(String2))
  85. #else
  86. int strcmp(const char *, const char *);
  87. #endif
  88.  
  89. /************************************************************************/
  90.  
  91. #if defined(__GNUC__) && defined(__OPTIMIZE__)
  92. extern __inline__ char *Stpcpy(char *Dest, const char *Source)
  93. {
  94.   while ((*Dest++=*Source++))
  95.     ;
  96.   return Dest-1;
  97. }
  98. #else
  99. char *Stpcpy(char *, const char *);
  100. #endif
  101.  
  102. /************************************************************************/
  103.  
  104. extern struct ExecBase *SysBase;
  105. extern struct Library *UtilityBase;
  106. extern struct DosLibrary *DOSBase;
  107. extern struct GfxBase *GfxBase;
  108. extern struct Library *LocaleBase;
  109. extern struct IntuitionBase *IntuitionBase;
  110.  
  111. extern struct SignalSemaphore JoystickSemaphore;
  112. extern struct SignalSemaphore HappyBlankerSemaphore;
  113. extern struct SignalSemaphore HappyBlankerSemaphore2;
  114. extern struct SignalSemaphore UserlistSemaphore;
  115.  
  116. /************************************************************************/
  117.  
  118. extern char IFFParseName[];
  119. extern char GameStuff[];
  120. extern char ProgDir[];
  121.  
  122. /************************************************************************/
  123.  
  124. #include "Saveds.h"
  125. #include "SavedsAsmD0.h"
  126. #include "SavedsAsmA0.h"
  127. #include "SavedsAsmD0A0.h"
  128. #include "SavedsAsmA0A1.h"
  129. #include "SavedsAsmD0A0A1.h"
  130. #include "SavedsAsmA0A1A2.h"
  131. #include "SavedsAsmA0A1A2A3.h"
  132. #include "SavedsAsmD0A0A1A2.h"
  133.  
  134. #ifndef PROTOS_H
  135. #include "protos.h"
  136. #endif
  137.  
  138. /************************************************************************/
  139.  
  140. #endif  /* GLOBAL_H */
  141.